import request from '@/utils/request'

// 查询报名信息列表
export function listEnroll(query) {
  return request({
    url: '/hps/enroll/list',
    method: 'get',
    params: query
  })
}

// 查询报名信息详细
export function getEnroll(id) {
  return request({
    url: '/hps/enroll/' + id,
    method: 'get'
  })
}

// 新增报名信息
export function addEnroll(data) {
  return request({
    url: '/hps/enroll',
    method: 'post',
    data: data
  })
}

// 修改报名信息
export function updateEnroll(data) {
  return request({
    url: '/hps/enroll',
    method: 'put',
    data: data
  })
}

// 删除报名信息
export function delEnroll(id) {
  return request({
    url: '/hps/enroll/' + id,
    method: 'delete'
  })
}

// 导出报名信息
export function exportEnroll(query) {
  return request({
    url: '/hps/enroll/export',
    method: 'get',
    params: query
  })
}

// 导出参赛报名信息
export function exportSiteEnroll(query) {
  return request({
    url: '/hps/enroll/exportSiteEnroll',
    method: 'get',
    params: query
  })
}

// 导出参赛报名信息
export function exportSkillEnroll(query) {
  return request({
    url: '/hps/enroll/exportSkillEnroll',
    method: 'get',
    params: query
  })
}

// 报名审核不通过
export function checkApply(query) {
  return request({
    url: '/hps/enroll/checkapply?' + query,
    method: 'get',
    timeout: 30000
  })
}

// 取消报名不通过
export function checkOut(data) {
  return request({
    url: '/hps/enroll/checkout',
    method: 'put',
    data: data
  })
}

// 报名批量审核通过
export function checkApplyBatch(id) {
  return request({
    url: '/hps/enroll/checkapplybatch/'+ id,
    method: 'put'
  })
}

// 取消报名批量审核通过
export function checkOutBatch(id) {
  return request({
    url: '/hps/enroll/checkoutbatch/'+ id,
    method: 'put'
  })
}

// 统计报名数量
export function countEnroll(query) {
  return request({
    url: '/hps/enroll/enrollCount',
    method: 'get',
    params: query
  })
}

// 报名成功退回待审核状态
export function rollBackAudit(id) {
  return request({
    url: '/hps/enroll/rollBackAudit/' + id,
    method: 'put'
  })
}
